package com.loong.common.enumerate;

public enum DeviceType {

	Windows(1, "windows", "Windows平台"),
	Mac(2, "mac", "Mac平台"),
	IOS(3, "ios", "IOS平台"),
	Android(4, "android", "Android平台"),
	Web(5, "web", "Web平台"),
	UnKnown(6, "unknown", "未知"),
	;

	private int value;
	private String desc;
	private String name;

	DeviceType(int value, String name, String desc) {
		this.value = value;
		this.name = name;
		this.desc = desc;
	}

	public int value() {
		return value;
	}

	public String desc() {
		return desc;
	}

	public String typeName() {
		return name;
	}

	public static DeviceType getDeviceType(short deviceType) {
		DeviceType deviceTypeEnum;
		switch (deviceType) {
			case 1:
				deviceTypeEnum = DeviceType.Windows;
			break;
			case 2:
				deviceTypeEnum = DeviceType.Mac;
			break;
			case 3:
				deviceTypeEnum = DeviceType.IOS;
			break;
			case 4:
				deviceTypeEnum = DeviceType.Android;
			break;
			case 5:
				deviceTypeEnum = DeviceType.Web;
			break;
			default:
				deviceTypeEnum = DeviceType.UnKnown;
			break;
		}
		return deviceTypeEnum;
	}

}
